package org.easydarwin.beans;

import java.util.List;

/**
 * Created by stamSuper on 2018/1/2.
 * 功能：
 */

public class User {
    private String token ;
    private String nickname;
    private String account;
    private String phone;
    private boolean online;

    private List<Role> roles;

    public User(String token, String nickname, List<Role> roles) {
        this.token = token;
        this.nickname = nickname;
        this.roles = roles;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public boolean isOnline() {
        return online;
    }

    public void setOnline(boolean online) {
        this.online = online;
    }

    public List<Role> getRoles() {
        return roles;
    }

    public void setRoles(List<Role> roles) {
        this.roles = roles;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"token\":\"")
                .append(token).append('\"');
        sb.append(",\"nickname\":\"")
                .append(nickname).append('\"');
        sb.append(",\"account\":\"")
                .append(account).append('\"');
        sb.append(",\"phone\":\"")
                .append(phone).append('\"');
        sb.append(",\"online\":")
                .append(online);
        sb.append(",\"roles\":")
                .append(roles);
        sb.append('}');
        return sb.toString();
    }
}
